from create import User, session

ret = session.query(User).all()
print(len(ret))
for item in ret:
    print('%d: %s, %s' %(item.id, item.name, item.extra))

ret = session.query(User).all()
for item in ret:
    print("%d %s %s" % (item.id, item.name, item.extra))
ret = session.query(User.name, User.extra).all()
for item in ret:
    print("%s %s" % (item.name, item.extra))
ret = session.query(User).filter_by(name="alex0").all()
for item in ret:
    print("%d %s %s" % (item.id, item.name, item.extra))
ret = session.query(User).filter_by(name="alex0").first()
print("%d %s %s" % (ret.id, ret.name, ret.extra))